10 REM DUMBTERM.BAS, A "DUMB TERMINAL" EMULATION PROGRAM. THIS IS THE SIMPLEST
20 REM FORM OF A TERMINAL EMULATION PROGRAM, SUPPORTING ONLY COM1 AND COM2 WITH
30 REM LIMITED COMMUNICATION PARAMETERES, AND NO ERROR CHECKING. TO PREVENT THE
40 REM COMMUNICATIONS INPUT BUFFER IN BASIC FROM OVERFLOWING, YOU MUST INCREASE
50 REM DEFAULT SIZE OF THE INPUT BUFFER IN ONE OF THE FOLLOWING WAYS:
60 REM 1. IF RUNNING FROM GWBASIC, USE THE COMMAND: GWBASIC DUMBTERM /C:32767
70 REM 2. IF COMPILING INTO AN EXE IN QUICKBASIC, USE THE OPTION: /O/C:32767
80 REM ************************************************************************
90 KEY OFF:FOR A=1 TO 10:KEY A,"":NEXT
100 CLS
110 PRINT "DUMB TERMINAL PROGRAM   01/04/98"
120 PRINT
130 PRINT "---- COM1 ----     ---- COM2 ----"
140 PRINT "F1   300,N,8,1     F2   300,N,8,1"
150 PRINT "F3  1200,N,8,1     F4  1200,N,8,1"
160 PRINT "F5  2400,N,8,1     F6  2400,N,8,1"
170 PRINT "F7  9600,N,8,1     F8  9600,N,8,1"
180 PRINT "F9 19200,N,8,1    F10 19200,N,8,1"
190 PRINT
200 PRINT "ESCape to exit"
210 B$=INKEY$:IF B$="" THEN 210
220 IF B$=CHR$(0)+CHR$(59) THEN OPEN "COM1: 300,N,8,1,CS,DS,CD" AS 1:GOTO 340
230 IF B$=CHR$(0)+CHR$(60) THEN OPEN "COM2: 300,N,8,1,CS,DS,CD" AS 1:GOTO 340
240 IF B$=CHR$(0)+CHR$(61) THEN OPEN "COM1:1200,N,8,1,CS,DS,CD" AS 1:GOTO 340
250 IF B$=CHR$(0)+CHR$(62) THEN OPEN "COM2:1200,N,8,1,CS,DS,CD" AS 1:GOTO 340
260 IF B$=CHR$(0)+CHR$(63) THEN OPEN "COM1:2400,N,8,1,CS,DS,CD" AS 1:GOTO 340
270 IF B$=CHR$(0)+CHR$(64) THEN OPEN "COM2:2400,N,8,1,CS,DS,CD" AS 1:GOTO 340
280 IF B$=CHR$(0)+CHR$(65) THEN OPEN "COM1:9600,N,8,1,CS,DS,CD" AS 1:GOTO 340
290 IF B$=CHR$(0)+CHR$(66) THEN OPEN "COM2:9600,N,8,1,CS,DS,CD" AS 1:GOTO 340
300 IF B$=CHR$(0)+CHR$(67) THEN OPEN "COM1:19200,N,8,1,CS,DS,CD" AS 1:GOTO 340
310 IF B$=CHR$(0)+CHR$(68) THEN OPEN "COM2:19200,N,8,1,CS,DS,CD" AS 1:GOTO 340
320 IF B$=CHR$(27) THEN COLOR 7,0:END
330 GOTO 100
340 CLS
350 PRINT "Now in terminal mode, use F10 to EXIT"
360 PRINT:LOCATE ,,1
370 REM ********** TERMINAL LOOP **********
380 IF EOF(1) THEN 410
390 A$=INPUT$(1,#1)
400 IF A$<>CHR$(10) THEN PRINT A$;
410 B$=INKEY$:IF B$="" THEN 380
420 IF B$=CHR$(0)+CHR$(68) THEN CLOSE:GOTO 100
430 PRINT #1,B$;
440 GOTO 380
